pub mod fbf;
pub mod file;
pub mod tech;

use super::{
    err, err_value, get_cfg_file, json, ok, throw_err, Base, Client, ECode, Lock, MapSv, RNull,
    Resp, SvCache, VBase, VMap, Value,
};
use fbf::Fbf;

pub async fn doit(
    data: &Value,
    model: &str,
    cmd: &str,
    cache: SvCache,
    lock: Lock,
    client: &Client,
) -> Resp {
    match model {
        "file" => {
            let v = file::FileDb;
            v.do_cmd(data, cmd, cache, lock).await
        }
        "tech" => {
            let v = tech::Tech;
            v.do_cmd(cmd, cache, lock, client).await
        }
        _ => throw_err!(ECode::NoServe, "no cmd"),
    }
}
